import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    currentView: Number,
    keyWord: "",
    musicPlayState: false,
    updateTimeEvent: {},
    musicInfo: {},
    currentTime: 0,
    currentMusicId: "0",
    musicList: [],
    loading: false,
    currentMusicIndex: 0,
    loginState: false
  },
  mutations: {
    setCurrentView(state, current) {
      state.currentView = current;
    },
    setkeyWord(state, current) {
      state.keyWord = current;
    },
    setCurrentMusicId(state, current) {
      state.currentMusicId = current;
    },
    setmusicPlayState(state, current) {
      state.musicPlayState = current;
    },
    setUpdateTimeEvent(state, current) {
      state.updateTimeEvent = current;
    },
    setMusicInfo(state, current) {
      state.musicInfo = current;
    },
    setCurrentTime(state, current) {
      state.currentTime = current;
    },
    setMusicList(state, current) {
      state.musicList = current;
    },
    addMusicList(state, current) {
      state.musicList.push(current)
    },
    setLoading(state, current) {
      state.loading = current
    },
    setcurrentMusicIndex(state, current) {
      state.currentMusicIndex = current
    },
    setLoginState(state, current) {
      state.loginState = current;
    }
  },
  actions: {
  },
  modules: {
  }
})
